package com.imut.oa.controller.user;

import com.imut.oa.common.BaseResponse;
import com.imut.oa.common.ResultUtils;
import com.imut.oa.pojo.dto.CommonUserPageQueryDTO;
import com.imut.oa.pojo.entity.Notice;
import com.imut.oa.pojo.vo.AttendanceRecordVO;
import com.imut.oa.service.NoticeService;
import com.imut.oa.util.ThreadLoaclUtil;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/user/notice")
@Slf4j
@Tag(name = "公告")
public class UserNoticeController {
    @Autowired
    private NoticeService noticeService;
    @GetMapping("/history")
    @Operation(summary = "获取公告记录")
    public BaseResponse<?> getNoticeHistory(@RequestParam("page") int page, @RequestParam("pageSize") int pageSize) {
        List<Notice> history = noticeService.getNoticeHistory(page, pageSize);
        return ResultUtils.success(history);
    }
}
